# =================================================================
# siconos configuration file.
# Check https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-packages
# This file has been generated during siconos install and
# may be used by another cmake project to retrieve all the configuration variables
# of siconos.
#
#
# Usage :
# 
# find_package(siconos)
#  ... define some target ...
# target_link_libraries(my_target ${siconos_LIBRARIES})
#
# A call to find_package(siconos) will define targets
# Siconos::<component> with component = externals, numerics, kernel ...
# 

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

# Name of the siconos package
set(PACKAGE_NAME siconos)

# set path to siconos installation
set_and_check(siconos_ROOT "@CMAKE_INSTALL_PREFIX@")
set_and_check(siconos_SCRIPT "@CMAKE_INSTALL_PREFIX@/bin/siconos")



# list of directories specifying installation prefixes to be searched by the find... routines
# of CMake. If set during build process of Siconos, it may be also useful at runtime.
set(CMAKE_PREFIX_PATH "@CMAKE_PREFIX_PATH@")

# set list of targets build by siconos project
set(installed_targets "@installed_targets@")


if(@HAVE_SICONOS_MECHANISMS@)
  set_and_check(siconos_mechanisms_SCRIPT "@CMAKE_INSTALL_PREFIX@/bin/siconos_mechanisms")
endif()


# Path (relative to siconos install) to cmake extra tools
set(SICONOS_CMAKE_MODULE_PATH @CMAKE_INSTALL_PREFIX@/@SiconosConfigPackageLocation@)
list(APPEND CMAKE_MODULE_PATH ${SICONOS_CMAKE_MODULE_PATH})


set(CMAKE_EXPORT_COMPILE_COMMANDS @CMAKE_EXPORT_COMPILE_COMMANDS@ CACHE BOOL "" FORCE)

set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@)
# Ensure that the same compiler will be used with siconos script
set(CMAKE_CXX_COMPILER @CMAKE_CXX_COMPILER@)
set(CMAKE_C_COMPILER @CMAKE_C_COMPILER@)
set(CMAKE_Fortran_COMPILER @CMAKE_Fortran_COMPILER@)
# --- Siconos extra components or options ---
set(HAS_PYTHON_WRAPPER @WITH_PYTHON_WRAPPER@)
if(HAS_PYTHON_WRAPPER)
  set(Python_EXECUTABLE  @Python_EXECUTABLE@)
endif()

# --- Numerics component extras ---
set(HAS_ONE_LP_SOLVER @HAS_ONE_LP_SOLVER@)

# --- Mechanics component extras ---
# mechanics component with bullet?
set(SICONOS_HAS_BULLET @SICONOS_HAS_BULLET@)

# mechanics (and/or mechanisms) component with occt?
set(SICONOS_HAS_OpenCASCADE @SICONOS_HAS_OpenCASCADE@)

if(@WITH_FCLIB@)
  set(FCLIB_ROOT @FCLIB_ROOT@)
  if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
    set(FCLIB_DIR @FCLIB_DIR@)
  endif()
  
  # Look for fclib in default path, FCLIB_DIR (cmake <3.12)
  # and/or FCLIB_ROOT (cmake >= 3.12).
  find_dependency(FCLIB 3.0.0 CONFIG REQUIRED)
endif()

# include siconos project targets
include("${CMAKE_CURRENT_LIST_DIR}/siconosTargets.cmake")

# --- Final check to set (or not) siconos_FOUND, siconos_numerics_FOUND and so on
check_required_components(siconos)


